package com.androidx.p013lv.mine.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.androidx.p013lv.base.BaseSdk;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.bean.VipCenterBean;

/* renamed from: com.androidx.lv.mine.adapter.VipCenterVipAdapter */
public class VipCenterVipAdapter extends BaseRecyclerAdapter<VipCenterBean.VipCardListBean, Holder> {
    public void MyHolder(Holder holder, int i) {
        holder.setData((VipCenterBean.VipCardListBean) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1207R.C1212layout.item_vip_center_vip, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.mine.adapter.VipCenterVipAdapter$Holder */
    public static class Holder extends BaseRecyclerHolder {

        /* renamed from: a */
        private TextView f322a;
        private ImageView item_selected_img;
        private TextView item_vip_card_date;
        private TextView item_vip_card_new_perice;
        private TextView item_vip_card_old_perice;
        private RelativeLayout item_vip_card_view;
        private TextView tv_deduct;

        Holder(View view) {
            super(view);
            this.f322a = (TextView) view.findViewById(C1207R.C1210id.f264g);
            this.item_vip_card_view = (RelativeLayout) view.findViewById(C1207R.C1210id.item_vip_card_view);
            this.item_vip_card_date = (TextView) view.findViewById(C1207R.C1210id.item_vip_card_date);
            this.item_vip_card_new_perice = (TextView) view.findViewById(C1207R.C1210id.item_vip_card_new_perice);
            this.item_vip_card_old_perice = (TextView) view.findViewById(C1207R.C1210id.item_vip_card_old_perice);
            this.item_selected_img = (ImageView) view.findViewById(C1207R.C1210id.item_selected_img);
            this.tv_deduct = (TextView) view.findViewById(C1207R.C1210id.tv_deduct);
        }

        /* access modifiers changed from: package-private */
        public void setData(VipCenterBean.VipCardListBean vipCardListBean) {
            this.item_vip_card_date.setText(vipCardListBean.getCardName());
            TextView textView = this.item_vip_card_new_perice;
            textView.setText("" + vipCardListBean.getDisPrice());
            this.item_vip_card_old_perice.setText(vipCardListBean.getDesc());
            if (vipCardListBean.getCardType() == 1) {
                this.item_vip_card_date.setTextColor(BaseSdk.getContext().getResources().getColor(C1207R.C1208color.amountColor));
            } else {
                this.item_vip_card_date.setTextColor(BaseSdk.getContext().getResources().getColor(C1207R.C1208color.white));
            }
            if (vipCardListBean.isSelected()) {
                this.item_selected_img.setVisibility(0);
                this.item_vip_card_view.setBackgroundResource(C1207R.C1209drawable.mine_vip_center_item_selected);
            } else {
                this.item_selected_img.setVisibility(8);
                this.item_vip_card_view.setBackgroundResource(C1207R.C1209drawable.mine_vip_center_item_un_selected);
            }
            if (vipCardListBean.isDeduct()) {
                this.tv_deduct.setVisibility(0);
            } else {
                this.tv_deduct.setVisibility(4);
            }
        }
    }
}
